/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bygf.dts.utility;

import javax.swing.JOptionPane;

/**
 *
 * @author pi
 */
public class MessageShow {
    public static final String MESSAGE_WARNING     = " 警告";  
    public static final String MESSAGE_INFORMATION = " 消息";  
    public static final String MESSAGE_ERROR = " 错误";  
      
    /*** 
     * Warning boxes 
     *  
     * @param mesg 
     */  
    public static void warningDialog(String mesg)  
    {  
        JOptionPane  
                .showMessageDialog(  
                    null,  
                    "<html><font color=\"yellow\"  style=\"font-weight:bold;" +  
                    "background-color:#666666\" >"  
                        + mesg + "</font></html>", MESSAGE_WARNING,  
                    JOptionPane.WARNING_MESSAGE);  
    }  
  
    /*** 
     * error 
     *  
     * @param mesg 
     */  
    
    public static void errorDialog(String mesg)  
    {  
        JOptionPane  
                .showMessageDialog(  
                    null,  
                    mesg , 
                    MESSAGE_ERROR,  
                    JOptionPane.ERROR_MESSAGE);  
    } 
//    public static void errorDialog(String mesg)  
//    {  
//        JOptionPane  
//                .showMessageDialog(  
//                    null,  
//                    "<html><font color=\"red\"  style=\"font-weight:bold;" +  
//                    "background-color:white\" >"  
//                        + mesg + "</font></html>", MESSAGE_ERROR,  
//                    JOptionPane.ERROR_MESSAGE);  
//    }  
  
    /*** 
     * information 
     *  
     * @param mesg 
     */  
    public static void infoDialog(String mesg)  
    {  
        JOptionPane.showMessageDialog(null,  
            "<html><font color=\"green\"  style=\"font-weight:bold;\" >" + mesg  
                + "</font></html>", MESSAGE_INFORMATION,  
            JOptionPane.INFORMATION_MESSAGE);  
    }  
}
